﻿namespace Core.Domain.ValueObjects;

#nullable disable

public record MenuMeta
{
    /// <summary>
    /// 菜单类型（0:菜单 1:iframe 2:外链 3:按钮）
    /// </summary>
    public int MenuType { get; init; } = 0;
    public string Title { get; init; }
    public string Name { get; init; }
    public string Path { get; init; }
    public string Component { get; init; }
    public int Rank { get; init; } = 99;
    public string Redirect { get; init; }
    public string Icon { get; init; }
    public string ExtraIcon { get; init; }
    public string EnterTransition { get; init; }
    public string LeaveTransition { get; init; }
    public string ActivePath { get; init; }
    public string FrameSrc { get; init; }
    public bool FrameLoading { get; init; } = true;
    public bool KeepAlive { get; init; } = false;
    public bool HiddenTag { get; init; } = false;
    public bool FixedTag { get; init; } = false;
    public bool ShowLink { get; init; } = true;
    public bool ShowParent { get; init; } = false;

    // 用于 EF Core 反序列化的无参构造函数
    private MenuMeta() { }

    // 主构造函数（可选）
    public MenuMeta(
        int menuType,
        string title,
        string name,
        string path,
        string component,
        int rank,
        string redirect,
        string icon,
        string extraIcon,
        string enterTransition,
        string leaveTransition,
        string activePath,
        string frameSrc,
        bool frameLoading,
        bool keepAlive,
        bool hiddenTag,
        bool fixedTag,
        bool showLink,
        bool showParent)
    {
        MenuType = menuType;
        Title = title;
        Name = name;
        Path = path;
        Component = component;
        Rank = rank;
        Redirect = redirect;
        Icon = icon;
        ExtraIcon = extraIcon;
        EnterTransition = enterTransition;
        LeaveTransition = leaveTransition;
        ActivePath = activePath;
        FrameSrc = frameSrc;
        FrameLoading = frameLoading;
        KeepAlive = keepAlive;
        HiddenTag = hiddenTag;
        FixedTag = fixedTag; 
        ShowLink = showLink;
        ShowParent = showParent;
    }
}
